import request from '@/utils/request'
import QS from 'qs'
// 获取所有权限树状图展示
export function getUserAuthChildrenList() {
  return request({
    url: '/user/getUserAuthChildrenList',
    method: 'get',
  })
}
// 获取角色对应的权限树状图展示
export function getRolesList() {
  return request({
    url: '/user/getRoleAuthChildrenList',
    method: 'get',
  })
}
// 删除角色对应的权限
export function deleteRoleAuth(roleId,authId) {
  return request({
    url: '/user/role/del/'+roleId+'/'+authId,
    method: 'delete',
  })
}

// 获取所有权限树状图展示
export function updateAuthMenu(roleId,data) {
  return request({
    url: '/user/role/update/'+roleId,
    method: 'post',
    data:QS.stringify(data, { indices: false })
  })
}

